Action hook 'rest_after_insert_{$this->post_type}'
in WP Core File wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php at line 778
Description
Fires after a single post is completely created or updated via the REST API. The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug. Possible hook names include: - `rest_after_insert_post` - `rest_after_insert_page` - `rest_after_insert_attachment`
Occurrences
Filename |
Line Number |
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php |
778 |
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php |
954 |
wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php |
414 |
wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php |
474 |
Parameters
Type |
Name |
Description |
WP_Post |
$post |
Inserted or updated post object. |
WP_REST_Request |
$request |
Request object. |
bool |
$creating |
True when creating a post, false when updating. |
PHP Doc
/**
* Fires after a single post is completely created or updated via the REST API.
*
* The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug.
*
* Possible hook names include:
*
* - `rest_after_insert_post`
* - `rest_after_insert_page`
* - `rest_after_insert_attachment`
*
* @since 5.0.0
*
* @param WP_Post $post Inserted or updated post object.
* @param WP_REST_Request $request Request object.
* @param bool $creating True when creating a post, false when updating.
*/